package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.DigitalCollectionProductInfoAuctionUserBidding;
import com.sc.nft.entity.DigitalCollectionProductInfoAuctionUserBiddingDetails;
import com.sc.nft.entity.vo.UserAuctionRecordPageVO;
import com.sc.nft.mapper.DigitalCollectionProductInfoAuctionUserBiddingDetailsMapper;
import com.sc.nft.mapper.DigitalCollectionProductInfoAuctionUserBiddingMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author：LiGen
 * @Package：com.sc.nft.dao
 * @Project：sc_metago
 * @name：DigitalCollectionProductInfoAuctionDao
 * @Date：2024/9/5 14:57
 * @Filename：DigitalCollectionProductInfoAuctionDao
 */
@Slf4j
@Repository
public class DigitalCollectionProductInfoAuctionUserBiddingDetailsDao extends ServiceImpl<DigitalCollectionProductInfoAuctionUserBiddingDetailsMapper, DigitalCollectionProductInfoAuctionUserBiddingDetails> {
    public boolean batchSave(List<DigitalCollectionProductInfoAuctionUserBiddingDetails> detailsList) {
        return baseMapper.batchSave(detailsList);
    }


    public List<DigitalCollectionProductInfoAuctionUserBiddingDetails> listByProductIdAndUserId(Long userId,Long productId) {
        LambdaQueryWrapper<DigitalCollectionProductInfoAuctionUserBiddingDetails> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(DigitalCollectionProductInfoAuctionUserBiddingDetails::getUserId,userId);
        queryWrapper.eq(DigitalCollectionProductInfoAuctionUserBiddingDetails::getProductId,productId);
        return list(queryWrapper);
    }


}
